import collections
class Solution(object):
    def minSetSize(self, arr):
        c = collections.Counter(arr)
        d = list(c.values())
        d.sort(reverse=True)
        t = len(arr) // 2
        now = 0
        for index, m in enumerate(d):
            now += m
            if now >= t:
                return index + 1

